package com.estore;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class ProductService {
    private List<Product> products;

    public ProductService() {
        initializeProducts();
    }

    private void initializeProducts() {
        products = new ArrayList<>();
        products.add(new Product("P001", "iPhone 14", new BigDecimal("5999.00"), 50));
        products.add(new Product("P002", "MacBook Pro", new BigDecimal("12999.00"), 30));
        products.add(new Product("P003", "AirPods Pro", new BigDecimal("1899.00"), 100));
        products.add(new Product("P004", "iPad Air", new BigDecimal("4399.00"), 40));
        products.add(new Product("P005", "Apple Watch", new BigDecimal("2999.00"), 60));
    }

    public List<Product> getAllProducts() {
        return new ArrayList<>(products);
    }
}